home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
EDUCATE
/
MATHX.ARJ
/
GRAPH.UTL
< prev
next >
Wrap
Text File
|
1991-06-16
|
15KB
|
487 lines
| GRAPH.UTL |
Z''=INFO:z'''=int((z''-int(z''/10000)*10000)/1000):if z'''=0}1
| COPYRIGHT 1991 BY DAVID W. DENKER, Box 115, Isanti, Mn. 55040 |
DSP N" SORRY, THIS FILE CAN ONLY BE RUN USING MATH EXTRA!"N
WAIT5:QUIT
#1
TITLE= GRAPH MAKING PROGRAM
aoff:koff
SAVV GRAFTEMP.VAR
GMOD0
#2
FC0:GOFF:over
cls:$T="":head b0f14; Hit the F1 key for help.;
dsp nn; Enter Graph Title: ;:$t=inp{400}
IF $T="0"}Q
dsp n; Enter F(X) using X: ;:$a=inp{404}
dsp n; Enter left div's: ;:n'=inp{402}
if n'<5}}n'=5
dsp n; Between maj div's: ;:d'=inp{403}
dsp n; Start with X = : ;:X=inp{405}:m'=x
dsp n; Add to X per div.: ;:s''=inp{406}
T''=INT(Z''*.1)-INT(Z''*.01)*10
#3
call221:dsp n; Enter graph type: ;:t'=inp(1){407}:WOFF
IF T'>0}}if t'<T-1}4:beep:go3
#4
call220
dsp n; Select top scale: ;:s'''=inp(2){401}:WOFF
IF S'''>0}}if s'''<t'''}6:beep:go4
#6
$i="N":IF T'>2}11
dsp n; Do you want a printout? (Y/N): ;:$i=input?(1){409}
#11
hoff:CALL 200:$i="Y"
dsp n; Is all the above correct? (Y/N): ;:$i=input?(1)
if $i<>"Y"}2
c'=0:c''=0:digl9:digr0:CLS:xoff:F''=0:IF N'>22}7
IF T'<3}7
GRAF:F''=2:fc(F''):row0:GOS500:X''=0:IF X'''<>0}7:GOFF:T''=1:GO3
#7
if ABS S''-int ABS S''=0}}if abs x-int abs x=0}10:digl6:digr3
#8
if ABS S''-int(ABS S''*100)*.01=0}}if abs x-int(abs x*100)*.01=0}10
digl4:digr5
#9
if ABS S''-int(ABS S''*1E4)*1E-4=0}}if abs x-int(abs x*1E4)*1E-4=0}10
digl2:digr8
#10
IF T'>2}12
dprn s2$tn:DSP " +("D4")"F4" -(*) ":PRN " +("D4") -(*) ":F'''=0:GO13
#12
DSP S2F7$TNF4" - "F2" + ":F'''=7
#13
CC(F''')
if t'>4}14
on(s''')c{173,174,175,176,177,178,179,180,181
,182,183,184,185,186,187,188,189,190}:go15
#14
on(s''')c{373,374,375,376,377,378,379,380,381,382,383,384,385}
#15
sc:if t'<3}19:fc(f'''):x=x+s'':dsp (x-s''):c''=0:n'=n'-2:fc1
if b'=1}18
dsp " ┼────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┤"
rc
go121
#18
DSP " ┼─────────┴─────────┴─────────┴─────────┴─────────┴─────────┤"
rc
go121
#19
sc:cc1:C''=D'-1
if b'=1}20
dprn s13" ├────┼────┼────┼────┼────┼────┼────┼────┼────┼────┼────┼────┤"
rc
go121
#20
dprn s13" ├────┬────┼────┬────┼────┬────┼────┬────┼────┬────┼────┬────┤"
rc
go121
#112:sc:cc1
dprn s13" │ · · · · · · · · · · · │"o
rc
goto120
#113:SC:FC(F'''):dprn (x-s''):cc1
dprn " ┤ · · · · · · · · · · · · · · · · · · · · · · · · · · · · · │"o
rc
goto120
#114:sc
if t'<3}123
dsp s13
if c''<>d'}115
if n'=>20}115
FC(F'''):COL0:dprn (x-s'')
#115
cc1
dsp " └───────────────────────────────────────────────────────────┘"
rc:ff:poff:goto210
#123
cc1
dprn s13" └────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┘"
rc:ff:poff:goto210
#116:COL15:prn s15:a''=a':sc:cc(C''')
#117:if a''=1}118:dprn d240:a''=a''-1:goto117
#118:cc(C'''):if a'=60}119:dprn d(D'')
#119:rc:goto121
#120:if a'<.5}121:if a'>60}}a'=60:if t'=2}116:SC:CC(C''')
if a'=60}121:col(a'+14):if t'>2}119:dsp d(D''):prn s(a'+14) d(D''):RC
#121:C'''=F'':D''=4:dprn n:a'=cint(F$A 1/s'):IF SGN A'<>-1}122
A'=ABS A':C'''=4:D''=42
#122:x=x+s''
c'=c'+1:c''=c''+1:if c'=n'+1}114:if c''<>d'}112:c''=0:goto113
#173:s'=.005:b'=1
dprn " 0 .05 .1 .15 .2 .25 .3 "n:ret
#174:s'=.01:b'=0
dprn " 0 .05 .1 .15 .2 .25 .3 .35 .4 .45 .5 .55 .6 "n:ret
#175:s'=.02:b'=0
dprn " 0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1 1.1 1.2"n:ret
#176:s'=.05:b'=1
dprn " 0 .5 1 1.5 2 2.5 3 "n:ret
#177:s'=.1:b'=0
dprn " 0 .5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 "n:ret
#178:s'=.2:b'=0
dprn " 0 1 2 3 4 5 6 7 8 9 10 11 12 "n:ret
#179:s'=.5:b'=1
dprn " 0 5 10 15 20 25 30 "n:ret
#180:s'=1:b'=0
dprn " 0 5 10 15 20 25 30 35 40 45 50 55 60 "n:ret
#181:s'=2:b'=0
dprn " 0 10 20 30 40 50 60 70 80 90 100 110 120"n:ret
#182:s'=5:b'=0
dprn " 0 25 50 75 100 125 150 175 200 225 250 275 300"n:ret
#183:s'=10:b'=0
dprn " 0 50 100 150 200 250 300 350 400 450 500 550 600"n:ret
#184:s'=20:b'=0
dprn " 0 100 200 300 400 500 600 700 800 900 1000 1100 1200"n:ret
#185:s'=50:b'=0
dprn " 0 250 500 750 1000 1250 1500 1750 2000 2250 2500 2750 3000"n:ret
#186:s'=100:b'=0
dprn " 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6000"n:ret
#187:s'=200:b'=1
dprn " 0 2000 4000 6000 8000 10000 12000"n:ret
#188:s'=2000:b'=1
dprn " 0 20000 40000 60000 80000 100000 120000"n:ret
#189:s'=20000:b'=1
dprn " 0 .2M .4M .6M .8M 1M 1.2M"n:ret
#190:s'=200000:b'=1
dprn " 0 2M 4M 6M 8M 10M 12M"n:ret
#200
if $i="Y"}201:ret
#201
$I="Y"
dsp N; Is the Printer on? (Y/N): ;:$i=INPUT?:dsp n:if $i="Y"}202:ret
#202:pon:ret
#210
if t'>2}c300:POFF
dsp f14r25o;"R"edo/quit;
i=kyin:if i=82}2:if i=114}2
LODV GRAFTEMP.VAR
DEL GRAFTEMP.VAR
quit
#220
if t'>4}225
t'''=19
WINDD WR(t'''+1)WC19BB1BF15R2C50;
(1) 0 - .3
(2) 0 - .6
(3) 0 - 1.2
(4) 0 - 3
(5) 0 - 6
(6) 0 - 12
(7) 0 - 30
(8) 0 - 60
(9) 0 - 120
(10) 0 - 300
(11) 0 - 600
(12) 0 - 1200
(13) 0 - 3000
(14) 0 - 6000
(15) 0 - 12000
(16) 0 - 120000
(17) 0 - 1.2M
(18) 0 - 12M
;:ret
#221
IF N'>22}222
IF T''>2}223
#222:T=4
WINDD WC13WR(T)C50R3BB1BF15;
(1) POINT
(2) BAR
;:ret
#223:T=8
WINDD WC22WR(T)C50R3BB1BF15;
(1) POINT
(2) BAR
(3) GRAPHIC LINE
(4) GRAPHIC FILL
(5) GRAPHIC LINE ±
(6) GRAPHIC FILL ±
;:RET
#225
t'''=14
WINDD WR(t'''+1)WC15BB1BF15R2C50;
(1) ± .3
(2) ± .6
(3) ± 1.2
(4) ± 3
(5) ± 6
(6) ± 12
(7) ± 30
(8) ± 60
(9) ± 120
(10) ± 300
(11) ± 600
(12) ± 1200
(13) ± 6000
;:ret
#300
sc:x=m':d'''=s''/y''':n''=(n'+1)*y'''+2:s'=s'/x''':M'''=14.5*X'''
m=60*x'''-1:m''=m+M''':n'''=x:y'=2.5*y''':A=0:n=y'''
IF T'=4}340
if t'>4}350
y'=y'+1
gos325:F'=F
if a'<1}}a'=1:x'=M'''+a':gos325
#305
i'=kyck:if i'=27}310
if a'<1}}a'=1:x''=M'''+a':gos326:IF B''=1}}IF F=4}C345:F'=F
x'=x'':y'=y'+1:gos325:if n=0}c356:if n''>0}305
#310
rc:ret
#325
a'''=a:a=F$A 1:a'=a/s':if abs a'>m}}a'=sgn a'*m
f=2:x=x+d''':n''=n''-1:n=n-1:IF SGN A'<>-1}r:A'=ABS A':f=4:ret
#326
IF F<>F'}330
FC(F)
if X'>=M''}}if x''>=m''}r
#327
LINE X(X')EX(X'')Y(Y')EY(Y')W1:RET
#330
FC(F'):IF ABS A>TAN 90*.1}327
FC(F):IF ABS A'''>TAN 90*.1}327
IF X'=14.5*X'''}R
FC(F'):LINE X(M'''+1)EX(X')Y(Y'-1)EY(Y'-1)W1
FC(F):LINE EX(X'')Y(Y')EY(Y'):RET
#340
N''=N''-1
#341
i'=kyck:if i'=27}310
gos325:IF ABS A>TAN90*.1}}F=6
IF B''=1}}IF F=4}C345:if a'=0}342:x'=M'''+a'
fc(f):LINE X(M''')EX(X')Y(Y')EY(Y')W1
#342
y'=y'+1:if n=0}c356:if n''>0}341:rc:ret
#345
FC(F):DOT X(M'''+M+5)Y(Y')T1:RET
#350
m=3
#351
dsp f1r(m)c44"|":m=m+1:if m<3+n'}351
dsp f1r2c44"┼"r(3+n')c44"┴"
m'=30*x'''
m=30*x'''-1
IF T'=6}366
Y'=Y'+1
gos360:F'=F
x'=M'''+m'+a':gos360
#355
i'=kyck:if i'=27}310
x''=M'''+m'+a':gos361:F'=F
x'=x'':y'=y'+1:gos360:if n=0}c356:if n''>0}355:rc:ret
#356
N=Y''':X=N'''+S'':N'''=X:RET
#360
A'''=A
a=F$A 1
a'=a/s'
if abs a'>m}}a'=sgn a'*m
f=2:x=x+d''':n''=n''-1:n=n-1
IF SGN A'<>-1}r:f=4:ret
#361
IF F<>F'}363
if X'=X''}}IF X'>=M''-1}r
if x'=X''}}IF X'<=m'''+1}r
FC(F)
#362
IF ABS(X'-X'')=>M'}R
LINE X(X')EX(X'')Y(Y')EY(Y')W1:RET
#363
IF ABS A'''>TAN90*.1}365
IF ABS A>TAN90*.1}364
FC(F'):LINE X(M'''+M'-1)EX(X')Y(Y')EY(Y')
FC(F):LINE EX(X'')Y(Y')EY(Y'):RET
#364
FC(F')
IF F'=4}}LINE X(M''')EX(X')Y(Y')EY(Y')
IF F'=2}}LINE X(M'''+M'+M-1)EX(X')Y(Y')EY(Y'):RET
#365
FC(F)
IF F=4}}LINE X(M''')EX(X'')Y(Y')EY(Y')
IF F=2}}LINE X(M'''+M'+M-1)EX(X'')Y(Y')EY(Y'):GO362
#366
i'=kyck:if i'=27}310
f'=f
gos360:x'=M'''+M'+a':IF SGN A'=-1}}X'=X'-1
if f<>f'}368
fc(f)
LINE X(M'''+M'-1)EX(X')Y(Y')EY(Y')W1
#367
y'=y'+1:if n=0}c356:if n''>1}366:rc:ret
#368
IF ABS A>TAN90*.1}369
IF ABS A'''>TAN90*.1}C370
FC(F):LINE X(M'''+M'-1)EX(X')Y(Y')EY(Y')W1:GO367
#369
FC(4):LINE X(M''')EX(M'''+M'-1)Y(Y')EY(Y')W1
FC(2):LINE X(M'''+M'-1)EX(M'''+M'+M-1):GO367
#370
FC(4):LINE X(M''')EX(M'''+M'-1)Y(Y'-1)EY(Y'-1)W1
FC(2):LINE X(M'''+M'-1)EX(M'''+M'+M-1):RET
#373:s'=.01:b'=1
dsp " -.3 -.2 -.1 0 .1 .2 .3 "n:ret
#374:s'=.02:b'=0
dsp " -.6 -.5 -.4 -.3 -.2 -.1 0 .1 .2 .3 .4 .5 .6 "n:ret
#375:s'=.04:b'=0
dsp "-1.2 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1 1.2"n:ret
#376:s'=.1:b'=1
dsp " -3 -2 -1 0 1 2 3 "n:ret
#377:s'=.2:b'=0
dsp " -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 "n:ret
#378:s'=.4:b'=0
dsp " -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 "n:ret
#379:s'=1:b'=0
dsp " -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 "n:ret
#380:s'=2:b'=0
dsp " -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 "n:ret
#381:s'=4:b'=0
dsp "-120 -100 -80 -60 -40 -20 0 20 40 60 80 100 120"n:ret
#382:s'=10:b'=0
dsp "-300 -250 -200 -150 -100 -50 0 50 100 150 200 250 300"n:ret
#383:s'=20:b'=0
dsp "-600 -500 -400 -300 -200 -100 0 100 200 300 400 500 600"n:ret
#384:s'=40:b'=1
dsp "-1200 -800 -400 0 400 800 1200"n:ret
#385:s'=200:b'=1
dsp "-6000 -4000 -2000 0 2000 4000 6000"n:ret
#400:windd wr8wc42r5c30;
Enter the title that will be displayed
or printed at the top of the graph.
The title can be up to 60 characters
long. If you want to quit the graph
utility here, enter 0.
Hit any key to continue.;
wait 40:woff:quit
#401:windd wr8wc42r5c30;
This is the scale that will be used at
the top of the graph and is the scale
for the result value of each line.
Select the scale by using the (number)
in front of the value range you want.
Hit any key to continue.;
wait 40:woff:call220:quit
#402:windd wr17wc70r5c4;
0 1 2 3 4 5 6
├────┼────┼────┼────┼────┼────┼── Enter the number of lines down
0├ . . . . . . . . . . . . . . . . the left side of the graph.
│ . . . . . . This graph has 9 lines. The
│ . . . . . . normal display can handle a
│ . . . . . . graph of 19 lines and still
40├ . . . . . . . . . . . . . . . . see the title. The printer
│ . . . . . . can handle as many as you have
│ . . . . . . paper for. You can get 50
│ . . . . . . lines on one sheet easy. If
80├ . . . . . . . . . . . . . . . . your video can handle CGA, EGA
└────┴────┴────┴────┴────┴────┴── or VGA graphic modes and you
want to use it, you must use
22 or less lines.
Hit any key to continue.;
wait50:woff:quit
#403:windd wr14wc67r5c4;
0 1 2 3 4 5 6
├────┼────┼────┼────┼────┼────┼── Enter the number of lines
0├ . . . . . . . . . . . . . . . . between each major division
│ . . . . . . on the left side of the
│ . . . . . . graph. The major divisions
│ . . . . . . are where the values are
4├ . . . . . . . . . . . . . . . . given. This graph has four
│ . . . . . . lines or divisions between
│ . . . . . . each major division.
│ . . . . . .
8├ . . . . . . . . . . . . . . . .
└────┴────┴────┴────┴────┴────┴── Hit any key to continue.;
wait50:woff:quit
#404:windd wr10wc38r6c38;
Enter the function or formula you
want to graph using "X". If you
want to graph the cosine function,
enter COS X <enter>. If you want
to graph z²+z-1, enter X^2+X-1.
The left scale will be used to
show the X value down the graph.
Hit any key to continue.;
wait50:woff:quit
#405:windd wr14wc67r5c4;
0 1 2 3 4 5 6
├────┼────┼────┼────┼────┼────┼── Enter the value the major
5├ . . . . . . . . . . . . . . . . divisions will start with
│ . . . . . . on the left side of the
│ . . . . . . graph. This graph started
│ . . . . . . with 5.
9├ . . . . . . . . . . . . . . . .
│ . . . . . .
│ . . . . . .
│ . . . . . .
13├ . . . . . . . . . . . . . . . .
└────┴────┴────┴────┴────┴────┴── Hit any key to continue.;
wait50:woff:quit
#406:windd wr14wc67r5c4;
0 1 2 3 4 5 6
├────┼────┼────┼────┼────┼────┼── Enter the value that will
0├ . . . . . . . . . . . . . . . . be added to each division
│ . . . . . . on the left side of the
│ . . . . . . graph. This graph has 2
│ . . . . . . added to each division.
8├ . . . . . . . . . . . . . . . . The major divisions will
│ . . . . . . print and/or display the
│ . . . . . . values at that point on
│ . . . . . . the graph.
16├ . . . . . . . . . . . . . . . .
└────┴────┴────┴────┴────┴────┴── Hit any key to continue.;
wait50:woff:quit
#407
if t>6}408
windd wr11wc36r6c32;
There are two types of graphs
that can be generated by this
utility on your video system.
The point graph of selection 1
or the bar graph of selection 2.
The bar type graph draws a bar
from the left side of the graph
to the resulting point.
Hit any key to continue.;
wait50:woff:call221:quit
#408
windd wr18wc36r3c32;
There are six types of graphs
that can be generated by this
utility on your video system.
The point graph of selection 1,
the bar graph of selection 2
or the graphic mode graphs of 3,
4, 5, and 6. The bar type graph
draws a bar from the left side
of the graph to the resulting
point. The graphic mode graphs
are line or fill from 0 type and
are of much better quality, but
they can only be printed using
the "Print Screen" Key. (EGA &
VGA video require DOS V4.0+)
Hit any key to continue.;
wait50:woff:call223:quit
#409
windd wr11wc36r6c20;
If you answer Y to this question
the graph will be sent to the
printer. It will also be sent
to the display monitor. The
printer must be on and ready to
print AND be able to print the
complete IBM character set.
(Including graphic characters)
Hit any key to continue.;
wait50:woff:quit
#500
g'=vidm:x'''=0:b''=0:if g'>19}r
x'''=data g'{0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,8,8,8,8,0}
y'''=data g'{0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,14,14,16,16,0}
B''=DATA g'{0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0}:ret